package com.aaa.service.impl;

import com.aaa.dao.StaffDao;
import com.aaa.dao.impl.StaffDaoImpl;
import com.aaa.entity.Staff;
import com.aaa.service.StaffService;
import com.aaa.util.BusinessException;

import java.util.List;
import java.util.Map;

public class StaffServiceImpl implements StaffService {
    private StaffDao staffDao = new StaffDaoImpl();

    @Override
    public Staff login(String staffId, String password) {

        return staffDao.login(staffId, password);
    }

    @Override
    public int updateStaffByStaffId(Staff staff) {

        return staffDao.updateStaffByStaffId(staff);
    }

    @Override
    public int addStaffByStaffId(Staff staff) {

        return staffDao.addStaffByStaffId(staff);
    }


    @Override
    public int deleteStaffByStaffId(int staffId) {
        return staffDao.deleteStaffByStaffId(staffId);
    }

    @Override
    public List<Staff> findAllStaff(Integer pageNumber, Integer pageSize, String searchId, String searchName) {
        return staffDao.findAllStaff(pageNumber, pageSize, searchId, searchName);
    }

    @Override
    public List<Staff> findStaffByStaffId(int staffId) {
        return staffDao.findStaffByStaffId(staffId);
    }

    @Override
    public List<Staff> findStaffByStaffName(String staffName) {
        return staffDao.findStaffByStaffName(staffName);
    }

    @Override
    public List<Map<String, Object>> getRole() {
        return staffDao.getRole();
    }


    @Override
    public List<Staff> getMaxStaffId() {
        return staffDao.getMaxStaffId();
    }

    @Override
    public int getAllStaffInfoCount(String searchId, String searchName) {
        // 总页数
        return staffDao.getAllStaffInfoCount(searchId, searchName);
    }
}
